﻿using B.S.Database.Domain.Entity;
using B.S.Database.ErrorCode;
using B.S.Database.Read.Api.Application.Commands.Processing;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Database.Read.Api.Controllers
{
    /// <summary>
    /// 深加工控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessingController : ControllerBase
    { /// <summary>
      /// 中介者
      /// </summary>
        private readonly IMediator mediator;
        /// <summary>
        /// 日志
        /// </summary>
        private readonly ILogger<BreedingController> logger;

        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator"></param>
        /// <param name="logger"></param>
        public ProcessingController(IMediator mediator, ILogger<BreedingController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 显示深加工
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<Apiresult<List<Processing_Infomation>>> ProcessingShow([FromQuery]ProcessingShowCommands request)
        {
            return mediator.Send(request);
        }
        /// <summary>
        /// 显示供应商
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<Apiresult<List<Supplier>>> SupplierShow([FromQuery]SupplierShowCommands request)
        {

        return mediator.Send(request); }
        /// <summary>
        /// 显示企业信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]

        public Task<Apiresult<List<Company_Information>>> CompanyShow([FromQuery]CompanyShowCommands request)
        {

        return mediator.Send(request); }
    }
    
}
